<style>
    .nav-main{
        background: #ffffff;
        box-shadow: 0 0 6px 1px rgba(0,0,0,0.1);
    }
    .nav-wrap{
        height:56px;
        background:#ffffff;
        z-index: 2;
        width:1200px;
        margin: 0 auto;
    }

    .nav-content >ul >li{
        border-right:1px solid #dedede;
        float:left;
        position: relative;
        line-height: 55px;
        z-index: 9;
    }

    .nav-content >ul >li>a{
        display:inline-block;
        padding:0px 30px;
        font-size: 16px;
    }

    .nav-content >ul >li> a:hover{
        color:#078cf2;
    }

    .nav-content >ul >li.current a{
        background:#078cf2;
        color:#ffffff;
    }

    .nav-content >ul >li.current a:hover{
        color:#ffffff;
    }
    
    
  .blog_name{
    line-height:60px;
    font-size: 28px;
    color:#ffffff;
    margin-left: 35px;
  }

  .blog_name a{
    color:#939393;
  }

  .user_wrap{
    height:40px;
    padding:20px 0 0 0;
    line-height: 40px;
  }

  .user_wrap a{
    font-size: 14px;
    color:#666666;

  }

</style>



<div class="nininav">
    <div class="w1200">
        <div class="layui-row">
            <div class="layui-col-lg10">
                <h1 class="blog_name">
                    <a href="" alt="{:lang('Xiaomu Content Management System')}">{:lang("Xiaomu Content Management System")}</a>
                </h1>
            </div>
            <div class="layui-col-lg1">
                <div class="user_wrap"><a href="{:url('admin/login/index')}">{:lang("Login")}</a></div>
            </div>
            <div class="layui-col-lg1">
                <div class="user_wrap">
                    <div class="layui-form-item">
                            <div class="layui-form">
                                <select lay-filter="demo-select-filter">
                                    <option value="zh-cn" {if condition="$lang eq 'zh-cn'"}selected{/if}>简体中文</option>
                                    <option value="en-us" {if condition="$lang eq 'en-us'"}selected{/if}>英文</option>
                                </select>
                            </div>
                    </div>  
                </div>
            </div>
        </div>
    </div>
</div>

<div class="nav-main">
    <div class="nav-wrap">
        <div class="nav-content" id="menu">
            <ul>
                <li class="{if condition='$current eq 0'}current{/if}">
                    <a href="/index.php">{$home}</a>
                </li>

                {volist name='nav' id='vo'}
                    <li class="{if condition='$vo.id eq $current'}current{/if}"><a href="{:url('index/category',['id'=>$vo.id])}">{:lang($vo.category_name)}</a></li>
                {/volist}
            </ul>
        </div>
    </div>
</div>

<script>
    $(function(){
        $(".menu>li").on("mouseenter",function(){
            $(this).find(".sub-menu").show();
        })

        $(".menu>li").on("mouseleave",function(){
            $(this).find(".sub-menu").hide();
        })

    })

    
    layui.use(['form', 'laydate', 'util'], function(){
        var form = layui.form;
        var layer = layui.layer;
        // select 事件
        form.on('select(demo-select-filter)', function(data){
            var elem = data.elem; // 获得 select 原始 DOM 对象
            var value = data.value; // 获得被选中的值
            var othis = data.othis; // 获得 select 元素被替换后的 jQuery 对象
            $.cookie("xmcms_lang",value,{ path: '/'});
            window.location.href=window.location.href
        });


    })
</script>